package es.udc.emarketapp.emarket.model.product.dao;

import es.udc.emarketapp.emarket.model.product.vo.ProductVO;
import es.udc.fbellas.j2ee.util.exceptions.InstanceNotFoundException;
import es.udc.fbellas.j2ee.util.exceptions.InternalErrorException;
import java.sql.Connection;
import java.util.List;



public interface SQLProductDAO {
	
	public ProductVO create(Connection connection, ProductVO productVO) 
		throws InternalErrorException;
	
	public boolean exists(Connection connection, Long idProd) 
		throws InternalErrorException;
	
	public ProductVO findById(Connection connection, Long idProd) 
		throws InstanceNotFoundException, InternalErrorException;

	public List<ProductVO> findByCategory(Connection connection, Long idCat,
                int levels, int startIndex, int count) throws InternalErrorException;

	public List<ProductVO> findByName(Connection connection, String name, 
		int startIndex, int count) throws InternalErrorException;

	public List<ProductVO> findByKeywords(Connection connection, 
		String keywords, int startIndex, int count) 
		throws InternalErrorException;
	
        public List<ProductVO> findByKeywordsAndCategory(Connection connection,
            String keywords, Long idCat, int levels, int startIndex, int count)
            throws InternalErrorException;

	public List<ProductVO> findBySeller(Connection connection,
		String idVendedor, int startIndex, int count) 
		throws InternalErrorException;

	public List<ProductVO> findByOrigin(Connection connection, 
        	String paisOrigen, int startIndex, int count) 
        	throws InternalErrorException;
		   
	public boolean isValid(Connection connection, Long idProd) 
		throws InstanceNotFoundException, InternalErrorException;
	
	public void invalidate(Connection connection, Long idProd) 
		throws InstanceNotFoundException, InternalErrorException;
	
	public ProductVO update(Connection connection, ProductVO productVO)
		throws InstanceNotFoundException, InternalErrorException;
	 
	public void remove(Connection connection, Long idProd) 
		throws InstanceNotFoundException, InternalErrorException;

}